package com.vhall.component.entity.data.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author shimingming
 * @since 2023/5/4 15:38
 */
@Getter
@AllArgsConstructor
public enum DataStatusEnum {

    ALL("1", "全部"),
    LIVE_STREAMING("2", "直播中"),
    LIVE_PLAYBACK("3", "直播回放"),


    ;
    private final String value;

    private final String description;

    public static String getDescription(String value) {
        DataStatusEnum parse = parse(value);
        if (parse != null) {
            return parse.getDescription();
        }
        return StringUtils.EMPTY;
    }

    public static DataStatusEnum parse(String value) {
        for (DataStatusEnum anEnum : DataStatusEnum.values()) {
            if (anEnum.getValue().equals(value)) {
                return anEnum;
            }
        }
        return ALL;
    }
}
